Ext.ns('TaxonTagger');
TaxonTagger.docinfoPanel = function(config){

	Ext.apply(this, config, {
			id: 'docinfopanel'	
		,	autoScroll: true
		,	padding: 10
		,	iconCls: 'icon_form'
		,	labelWidth: 70
		,	defaults:{
				anchor: '100%'
			}
		,	items: [{
					xtype: 'textfield'
				,	name: 'title'
				,	fieldLabel: this.txtFieldTitle
				,	listeners: {
							change: this.updateLocalStore
						,	scope: this
					}
			}, {
					xtype: 'textfield'
				,	name: 'author'
				,	fieldLabel: this.txtFieldAuthor
				,	scope: this
				,	listeners: {
							change: this.updateLocalStore
						,	scope: this
					}
			}, {
					xtype: 'textfield'
				,	name: 'publisher'
				,	fieldLabel: this.txtFieldPublisher
				,	scope: this
				,	listeners: {
							change: this.updateLocalStore
						,	scope: this
					}
			}, {
					xtype: 'datefield'
				,	name: 'date'
				,	fieldLabel: this.txtFieldDate
				,	scope: this
				,	listeners: {
							change: this.updateLocalStore
						,	scope: this
					}
			}, {
					xtype: 'textfield'
				,	name: 'issn'
				,	fieldLabel: this.txtFieldIssn
				,	scope: this
				,	listeners: {
							change: this.updateLocalStore
						,	scope: this
					}
			},{
					xtype: 'textfield'
				,	name: 'isbn'
				,	fieldLabel: this.txtFieldIsbn
				,	scope: this
				,	listeners: {
							change: this.updateLocalStore
						,	scope: this
					}
			},{
					xtype: 'textfield'
				,	name: 'doi'
				,	fieldLabel: this.txtFieldDoi
				,	scope: this
				,	listeners: {
							change: this.updateLocalStore
						,	scope: this
					}
			},{
					xtype: 'textfield'
				,	name: 'sici'
				,	fieldLabel: this.txtFieldSici
				,	scope: this
				,	listeners: {
							change: this.updateLocalStore
						,	scope: this
					}
			},{
					xtype: 'textfield'
				,	name: 'url'	
				,	ref: 'url'
				,	fieldLabel: this.txtFieldUrl
				,	readOnly: true
			}]
	});
	
	TaxonTagger.docinfoPanel.superclass.constructor.call(this, config);

};

Ext.extend(TaxonTagger.docinfoPanel, Ext.FormPanel, {

		updateLocalStore: function(){
			TaxonTagger.currentDocument.info = this.getForm().getValues();
			this.fireEvent('docDataChanged', this.localStorageUrl, this );
		}

	,	loadDocData: function() {
			this.getForm().setValues(TaxonTagger.currentDocument.info);
		}

});